// 设置相关 store

const state = {
    theme: 'light', // 主题色
    desc: '测试demo'
}
const mutations = {
    setTheme(state, newTheme) {
        state.theme = newTheme
    }
}
const actions = {
    asyncUpdateThemeSecond(context, newTheme) {
        setTimeout(() => {
            context.commit('setTheme', newTheme)
        }, 1000)
    }
}
const getters = {}

export default {
    // 使用辅助函数需要开启命名空间
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}
